import request from '@/plugins/axios'

export function fetchList(query) {
  return request({
    url: '/api/financecollectionactual/page',
    method: 'get',
    params: query
  })
}

export function addObj(obj) {
  return request({
    url: '/api/financecollectionactual',
    method: 'post',
    data: obj
  })
}

export function getObj(id) {
  return request({
    url: '/api/financecollectionactual/' + id,
    method: 'get'
  })
}

export function delObj(id) {
  return request({
    url: '/api/financecollectionactual/' + id,
    method: 'delete'
  })
}

export function putObj(obj) {
  return request({
    url: '/api/financecollectionactual',
    method: 'put',
    data: obj
  })
}

//根据合同id查询合同
export function getRentContractId(id) {
    return request({
        url: '/api/financecollectionactual/rentContract/' + id,
        method: 'get'
    })

}
//收款，合并收款页面数据
export function getConsolidatedCollection(contractId,receivableId) {
    return request({
        url: '/api/lessorcontractpayable/consolidatedCollection/' + contractId+'/'+receivableId,
        method: 'get'
    })
}
//合同基本信息（新建应付）
export function getRentContractList() {
    return request({
        url: '/api/lessorcontractpayable/getRentContractList',
        method: 'get'
    })
}

//导入数据
export function receivableImport(obj) {
    return request({
        url: '/api/financecollectionactual/receivableImport',
        method: 'post',
        data: obj,
        config:{
            headers:{'Content-Type':'multipart/form-data'}
        }
    })
}
